public class test {
    public static void main(String[] args) {
        
    }
}

class Solution {
    public int countAsterisks(String s) {
        // 2   4  6  8
        int count = 0;
        int n = s.length();
        int ans = 0;

        for(int i = 0;i < n;i++){
            if(s.charAt(i) == '|'){
                count++;
            }
            if(count % 2 == 0&&s.charAt(i) == '*'){
                ans++;
            }
        }

        return ans;
    }
}
